package com.easycamera

import android.Manifest
import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.easycamera.activity.CameraActivity
import com.tbruyelle.rxpermissions2.RxPermissions


class MainActivity : AppCompatActivity() {
    @SuppressLint("CheckResult")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        RxPermissions(this).request(Manifest.permission.CAMERA,
                Manifest.permission.READ_EXTERNAL_STORAGE,
                Manifest.permission.WRITE_EXTERNAL_STORAGE,
                Manifest.permission.INTERNET)
                .subscribe({}, {})

        findViewById<View>(R.id.button_camera).setOnClickListener { v ->

            startActivity(Intent(this, CameraActivity::class.java))

        }
    }


}